home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / programming / arexx / psx / psx.rexx next >
OS/2 REXX Batch file  |  1999-06-14  |  2KB  |  91 lines

  1. /* 
  2.  *    Find lockout area of PSX discs.
  3.  *
  4.  *    (c) 1999 Stephen Evans, 26th May 1999
  5.  *      (Read copywrite message has bored
  6.  *       Out of Skull)
  7.  
  8. 0.1 First aminet release.
  9. 0.2 Bug fix when the psx exe doesn't sit in root dir.
  10.  
  11.      *********Greets to************
  12.  
  13.  
  14. Dave 'Dibbo' Handsaker - For generaly stunning me in everything he does and
  15. for not being a stereotypical 18-year-old.
  16.  
  17. Kaye 'World' Bannister - For puting up with the guy above and making him
  18. the most happiest guy in the world, oh and for making me laugh :)
  19.  
  20. Dannie 'Wade' Hammonds - Cool pixel gfx dude no photoshop here !
  21.  
  22. Lee 'Someone' Wooldridge - General beer monster and kebab eating chum.
  23.  
  24. Grant P - For OS 3.0 rom replacments after I pluged mine in upside down and
  25. turning them into electric room heaters.
  26.  
  27.  
  28. $VER:PsxCountry 0.2 (26/05/99) 
  29.  
  30.  
  31.  */
  32.  
  33.  
  34.  
  35.  
  36.  
  37. /* See if CD is a PSX disc */
  38.  
  39. If ~Exists("CD0:System.cnf") Then Do
  40.    Echo "Disc in cd-rom device doesn't appear to be a PSX disc!"
  41.    Exit 10
  42. End
  43.  
  44.  
  45. /* Read Psx disc config & And find Boot exe */
  46.  
  47. Open(cfg,"CD0:System.cnf")
  48. FLine = ReadLn(cfg)
  49. Close(cgf)
  50.  
  51. Parse Var Fline ':\'name';'
  52.  
  53.  
  54.  
  55. Posit = POS('\',name)
  56.  
  57. If Posit > 0 then do
  58.    Parse Var Name bit1'\'Bit2
  59.    Name = Bit1'/'Bit2
  60. End
  61.  
  62. echo 'cFound Psx EXE file 'Name
  63.  
  64.  
  65. /* Read 64kb of the PSX exe and parse out the 
  66.  * country lockout area
  67.  * :)
  68.  */
  69.  
  70.  
  71. Open(Fileo,"cd0:"name,R)
  72. Lineo = Readch(Fileo,65535)
  73. Close(Fileo)
  74.  
  75. /* The PSX executable MUST be in this format !
  76.    Entertainment Inc. for ?# area */
  77.  
  78. Parse Var lineo 'Entertainment Inc. for 'Whatever' area'
  79.  
  80.  
  81. /* Report findings to cli */
  82.  
  83. echo 'This Psx disc is for the 'Whatever' area.'
  84.  
  85.  
  86. /* If the area isn't europe then disc has to be NTSC */
  87.  
  88. If Whatever ~= 'Europe' Then Echo 'This Disc is NTSC video'
  89. Else Echo 'This Disc is PAL video'
  90. Exit 0
  91.